package com.gdpu.project.service;

import java.util.List;

import com.gdpu.page.vo.QueryResult;
import com.gdpu.project.vo.Email;
import com.gdpu.project.vo.News;
import com.gdpu.project.vo.Teacher;

public interface TeacherService {

	// TeacherService
	/**
	 * 新增教师信息
	 * 
	 * @param teacher
	 *            教师对象
	 * @return true 新增成功，反之信息失败
	 */
	public abstract Boolean addTeacher(Teacher teacher);

	/**
	 * 修改教师信息
	 * 
	 * @param teacher
	 * @return
	 */
	public abstract Boolean updateTeacher(Teacher teacher);

	/**
	 * 删除教师信息
	 * 
	 * @param teacher
	 * @return
	 */
	public abstract Boolean deleteTeacher(Teacher teacher);

	/**
	 * 教师登录验证
	 * 
	 * @param teacherId
	 * @param password
	 * @param role
	 * @return
	 */
	public abstract Boolean checkTeacherLogin(String teacherId,
			String password, Integer role);

	/**
	 * 根据TeacherId查找Teacher
	 * 
	 * @param teacherId
	 * @return
	 */
	public abstract Teacher findTeacherById(String teacherId);
	
	/**
	 * 统计普通教职工数量
	 * @return
	 */
	public abstract int countOfTeacher(int role);
	
	/**
	 * 查询所有的Teacher
	 * @return
	 */
	public abstract List<Teacher> findAllTeacher(int role);

	// EmailService
	/**
	 * 新增Email
	 * 
	 * @param email
	 */
	public abstract Boolean addEmail(Email email);

	/**
	 * 通过EmailId删除Email
	 * 
	 * @param emailId
	 * @return
	 */
	public abstract Boolean deleteEmailById(int emailId);

	/**
	 * 通过emailId查找Email
	 * 
	 * @param emailId
	 * @return
	 */
	public abstract Email findEmailById(int emailId);

	/**
	 * 通过收件人查找Email
	 * 
	 * @param teacherId
	 * @return
	 */
	public abstract List<Email> findEmailByReceiver(Teacher teacherId);

	/**
	 * 通过发件人查找Email
	 * 
	 * @param teacherId
	 * @return
	 */
	public abstract List<Email> findEmailBySender(Teacher teacherId);
	
	/**
	 * 统计邮件的总数
	 * @return
	 */
	public abstract int countOfEmail();
	/**
	 * 邮件分页
	 * @param pageNo
	 * @return
	 */
	public abstract List<Email> splitPageEmail(int pageNo);
	
	/**
	 * 分页查找发出邮件
	 * @param teacherId
	 * @param firstindex
	 * @param maxresult
	 * @return
	 */
	public QueryResult<Email> findEmailBySender(String teacherId,int firstindex,int maxresult);
	/**
	 * 分页查找接收邮件
	 * @param teacherId
	 * @param firstindex
	 * @param maxresult
	 * @return
	 */
	public QueryResult<Email> findEmailByReceiver(String teacherId,int firstindex,int maxresult);
	// NewsService
	/**
	 * 新增News
	 */
	public abstract Boolean addNews(News news);

	/**
	 * 通过NewsId删除News
	 * 
	 * @param newsId
	 * @return
	 */
	public abstract Boolean deleteNewsById(int newsId);

	/**
	 * 修改News
	 * 
	 * @param news
	 * @return
	 */
	public abstract Boolean updateNews(News news);

	/**
	 * 通过NewsId查找新闻
	 * 
	 * @param newsId
	 * @return
	 */
	public abstract News findNewsById(int newsId);

	/**
	 * 查找最新的News
	 * 
	 * @return
	 */
	public abstract List<News> findRecentNews();

	/**
	 * 查找所有News
	 * 
	 * @return
	 */
	public abstract List<News> findAllNews();

	/**
	 * 新闻的点击量加1
	 * 
	 * @param id
	 */
	public abstract void addClickRateById(int newsid);

	/**
	 * 统计新闻的条数
	 * 
	 * @return 新闻条数 int
	 */
	public abstract int countOfNews();
	/**
	 * 新闻分页
	 * @param pageNo
	 * @return
	 */
	public abstract List<News> splitPage(int pageNo);
	/**
	 * 新闻分页显示
	 * @param firstindex
	 * @param maxresult
	 * @return
	 */
	public QueryResult<News> findAllNews(int firstindex,int maxresult);
	/**
	 * 根据名字查找老师
	 * @param name
	 * @return
	 */
	public List<Teacher> findByName(String name);

}